/*
 * ============================================================================
 * Copyright Notice!
 * ----------------------------------------------------------------------------
 * This file contains proprietary and confidential information belonging to the
 * group of people involvled in developing this project.  Reproduction, disclosure 
 * or use without specific written authorization from project stake holders is 
 * prohibited. Please refer the readme.txt in project installation folder for more
 * specific contacts
 *
 * All rights reserved.
 * ============================================================================
 */
package edu.uwm.universitydb.dao.student;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import edu.uwm.universitydb.framework.nontransactional.db.command.impl.NonTransactionalDataManipulationCommandBase;

/**
 * <code>DeleteStudentCommand</type>
 * Command class to delete a student
 * 
 * @author Shyam Nair
 */
public class DeleteStudentCommand extends NonTransactionalDataManipulationCommandBase
{

    /** delete query */
    private static String SQL = "delete from university.grad_student where grad_ssn = ?;";

    /** attribute holding ssn */
    private final String mSSN;

    /**
     * 
     * @param ssn
     */
    public DeleteStudentCommand(final String ssn)
    {
        mSSN = ssn;
    }

    /*
     * (non-javadoc)
     * @see edu.uwm.universitydb.framework.db.command.DBCommand#getSQL()
     */
    @Override
    public String getSQL()
    {
        return SQL;
    }

    /*
     * (non-javadoc)
     * @see edu.uwm.universitydb.framework.db.command.DBCommand#setParameters(java.sql.PreparedStatement)
     */
    @Override
    public void setParameters(final PreparedStatement pStmt) throws SQLException
    {
        pStmt.setString(1, mSSN);
    }

}
/*
 * ============================================================================
 * Change History
 * ----------------------------------------------------------------------------
 * Apr 19, 2014   Shyam Nair
 * File created
 * ----------------------------------------------------------------------------
 */